<!--{template ADMIN_DIRECTORY/tpl/admin_header}-->
<style type="text/css">
	table tr .t_r{text-align:right}
</style>
<div class="page_title">
  <h1>{$model_info[model_name]}{$_lang['task_config']}</h1>
    <div class="tool">
      <a href="index.php?do={$do}&model_id={$model_id}&view={$view}&op=config">{$_lang['basic_config']}</a>
      <a href="index.php?do={$do}&model_id={$model_id}&view={$view}&op=control" class="here">{$_lang['control_config']}</a>
      <a href="index.php?do={$do}&model_id={$model_id}&view={$view}&op=priv">{$_lang['private_config']}</a>
    </div>
</div>
<div class="box post">
<div class="tabcon">
 <div class="title"><h2>{$_lang['control_config']}</h2></div>
  <form name="frm_config_reward" action="{$ac_url}" method="post" id="frm_config_reward">
  <input type="hidden" name="pk[model_id]" value="{$model_id}">
	<table width="100%" border="0" cellspacing="0" cellpadding="0">
  	
	<tr>
		 <th scope="row" width="200"> <b>{$_lang['task_conmission_tactic']}</b>:</th><td>&nbsp;</td>
	</tr>
	<tr>
		<th scope="row" width="200" class="t_r">{$_lang['task_auditing_cash_set']}{$_lang['zh_mh']}</th>
		 <td>
			<input type="text" size="10"   name="conf[audit_cash]" id="audit_cash" value="{$audit_cash}"  limit="required:false;type:float" msg="{$_lang['txt_task_auditing_cash_msg']}" title="{$_lang['txt_task_auditing_cash_title']}" msgArea="audit_moeny_msg"  class="txt"> {$_lang['yuan']}
				{$_lang['task_cash_notice']}<span id="audit_moeny_msg"></span>
		</td>
    </tr>
	<tr>
		<th scope="row" width="200" class="t_r">{$_lang['set_task_min_cash']}:</th>
		 <td>
			<input type="text" size="10"   name="conf[min_cash]" id="min_cash" value="{$min_cash}" limit="type:float;required:true;between:1-" msg=" {$_lang['task_min_cash_msg']}" title="{$_lang['task_min_cash_title']}"  msgArea="task_min_cash_msg" class="txt"/>{$_lang['yuan']}
			{$_lang['task_min_cash_notice']}<span id="task_min_cash_msg"></span>
		 </td>
	</tr>
	<tr>
		<th scope="row" width="200" class="t_r">{$_lang['task_deduct_rate']}:</th> 
		<td>
			<input type="text" size="10" name="conf[task_rate]" value="{$task_rate}" id="task_rate" limit="type:int;len:1-2;between:0-99" msg="{$_lang['task_deduct_rate_msg']}" title="{$_lang['task_deduct_rate_title']}" msgArea="deduct_scale_msg" class="txt"/>%{$_lang['task_deduct_rate_title']}<span id="deduct_scale_msg"></span>
		</td>
	</tr>
	<tr>
		<th scope="row" width="200" class="t_r">{$_lang['deduct_rate_from_fail_task']}:</th> 
		<td>
			<input type="text" size="10" name="conf[task_fail_rate]" id="task_fail_rate" value="{$task_fail_rate}" limit="type:int;len:1-2;between:0-99" msg="{$_lang['fail_task_deduct_rate_msg']}" title="{$_lang['fail_task_deduct_rate_title']}" msgArea="fail_rate_msg" class="txt"/>%{$_lang['fail_task_deduct_rate_title']}<span id="fail_rate_msg"></span>
		</td>
	</tr>
	<!--
	<tr>
		<th scope="row" width="200" class="t_r">{$_lang['task_automate_choose']}:</th> 
		 <td>
			<label for="end_action_1"><input type="radio"  {if $end_action =='refund'||!$end_action}checked{/if} name="conf[end_action]" id="end_action_1" value="refund">{$_lang['close']}</label>
			<label for="end_action_3"><input type="radio" {if $end_action =='split' }checked{/if} name="conf[end_action]" id="end_action_2" value="split">{$_lang['open']}</label>
			<label id="slt" style="display:none"><input type="text" name="conf[witkey_num]" value="{$witkey_num}" id="witkey_num" limit="type:int;between:1-" msg="{$_lang['task_automate_choose_msg']}" title="{$_lang['task_automate_choose_title']}" class="txt">{$_lang['task_automate_choose_notice']}</label>
			 {$_lang['only_click_mode_can_be_effect']}
		 </td>
	</tr>
	-->
    
  	<tr><th scope="row" width="200">{$_lang['set_task_time_rule']}:</th><td>&nbsp;</td></tr>
	<tr>
	 <th scope="row" width="200" class="t_r">{$_lang['time_rule']}{$_lang['zh_mh']}</th>
	 <td id="td_cash_rul" class="td_cash_rul">
	  <ul id="add_new_rul" style="list-style:none">
	  	{loop $time_rule $k $v}
			<li>
				<span id="span_{$k}"><!--{eval echo $k+1;}--></span>
				<input type="hidden" name="">
				 <input type="text" size="10" name="timeOld[{$v[day_rule_id]}][rule_cash]" id="rule_cash_{$k}" value="<!--{eval echo  floatval($v['rule_cash'])}-->" limit="required:true;type:float"          msg="{$_lang['task_min_cash_msg']}"    title="{$_lang['check_min_cash_rule']}," msgArea="span_time_{$k}"  class="txt"/>{$_lang['yuan_over']} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				 <input type="text" size="10" name="timeOld[{$v[day_rule_id]}][rule_day]"  id="rule_day_{$k}"  value="{$v['rule_day']}"  limit="required:true;type:int;between:1-" msg="{$_lang['time_rule_day_msg']}" title="{$_lang['time_rule_day_title']}" msgArea="span_time_{$k}"  class="txt"> {$_lang['day']} 
				<span id="span_time_{$k}"></span>
				<a href="javascript:;" class="del_time_rule" rel="{$v[day_rule_id]}">{$_lang['delete_rule']}</a>
			</li>
		{/loop}
		</ul>
		<a href="javascript:;" id="add_time_rule">{$_lang['add_rule']}</a>
		</td>
	</tr>
	<tr>
		<th scope="row" width="200" class="t_r">{$_lang['task_min_day']}:</th>
		 <td>
			<input type="text" size="10" id="min_day"  name="conf[min_day]"  value="{$min_day}" limit="type:int;require:true;between:1-" msg="{$_lang['task_min_day_msg']}" title="{$_lang['task_min_day_title']}" msgArea="span_min_day" class="txt">{$_lang['task_public_time_notice']}
			<span id="span_min_day"></span>
		 </td>
	</tr>
	<tr>
		<th scope="row" width="200" class="t_r">{$_lang['task_choose_days']}</th> 
		 <td>
			<input type="text" size="10" name="conf[choose_time]" id="choose_time" value="{$choose_time}"  limit="required:true;type:int;between:1-20" msg="{$_lang['choose_time_msg']}" title="{$_lang['choose_time_title']}"  msgArea="span_draft_time" class="txt">{$_lang['choose_time_notice']}<span id="span_draft_time"></span>
		</td>
	</tr>
	

	<tr><th scope="row" width="200">{$_lang['affect_extent_price']}</th><td>&nbsp;</td></tr>
		<tr>
	 <th scope="row" width="200" class="t_r">{$_lang['affect_extent_rule']}</th>
	 <td id="td_cash_rul">
	  <ul id="add_fans_rul" style="list-style:none">
	  	<!-- 影响力规则 -->
	  	{loop $sina_affect_rule $k $v}
			<li>
				<span id="span_{$k}"><!--{eval echo keke_glob_class::num2ch($k);}-->级影响力</span>
				<input type="text" size="10" name="affect_rule[$k]"  id="rule_{$k}"  value="<!--{eval echo  floatval($v['cash'])}-->"  limit="required:true;type:float" msg="{$_lang['effect_rule_day_msg']}" title="{$_lang['effect_rule_day_title']}" msgArea="span_time_{$k}"  class="txt"> {$_lang['yuan']} <span id="span_time_{$k}"></span>
			</li>
		{/loop}
		</ul>
		</td>
	</tr>
		<tr>
		<th scope="row" width="200">&nbsp;</th>
		<td>
            <div class="clearfix padt10">
			 <button type="submit" name="sbt_edit" class="positive primary  button" value="1" onclick="return checkForm(document.getElementById('frm_config_reward'))"><span class="check icon"></span>{$_lang['submit']}</button>
			</div>
		</td>
	</tr>
  </table>
  </form>
   </div>
 </div>
<script type="text/javascript">
$(function(){
	if($("#end_action_1").attr("checked")==true){
		$("#slt").hide();
	}
	if($("#end_action_2").attr("checked")==true){
		 $("#slt").show();
	 }
	$("#end_action_1").click(function(){
		$("#slt").hide();
	})
	$("#end_action_2").click(function(){
		  $("#slt").show();
	})
	
	$("#add_fans_extent_rule").click(function(){
		var ruleNum=parseInt($("#add_fans_rul").find("li").length+1);
		var newRule=$("<li><span id='span_"+ruleNum+"'>"+ruleNum+"</span><input type='text' size='10' name='fansnew["+ruleNum+"][min]' class='txt'/>&nbsp;&nbsp;-&nbsp;&nbsp;<input type='text' size='10' name='fansnew["+ruleNum+"][max]' class='txt'/>{$_lang['people']}"+
				 "&nbsp;&nbsp;&nbsp;&nbsp;<input type='text' size='10' name='fansnew["+ruleNum+"][cash]' class='txt'> {$_lang['yuan']}<br></li>");
			newRule.appendTo($("#add_fans_rul"));
	})	
	$(".del_fans_rule").click(function(){
		var timeRuleId=parseInt($(this).attr("rel"));
		
			if(!isNaN(timeRuleId)){
				
				$.getJSON("{$ac_url}",{ac:'del_fans_rule',rule_id:timeRuleId},function(){});
			}
		$(this).parent().remove();
	})
		$("#add_time_rule").click(function(){
		var ruleNum=parseInt($("#add_new_rul").find("li").length)+1;
		var newRule=$("<li><span id='span_"+ruleNum+"'>"+ruleNum+"</span><input type='text' size='10' name='timeNew["+ruleNum+"][rule_cash]' class='txt'/>{$_lang['yuan_over']} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+
				 "&nbsp;&nbsp;<input type='text' size='10' name='timeNew["+ruleNum+"][rule_day]' class='txt'> {$_lang['day']}<br></li>");
			newRule.appendTo($("#add_new_rul"));
	})	
	$(".del_time_rule").click(function(){
		var timeRuleId=parseInt($(this).attr("rel"));
			if(!isNaN(timeRuleId)){
				$.getJSON("{$ac_url}",{ac:'del_time_rule',rule_id:timeRuleId},function(){});
			}
		$(this).parent().remove();
	})	

  })
</script>
<!--{template ADMIN_DIRECTORY/tpl/admin_footer}-->